/*
 * CVideoFrameFilter.h
 *
 *  Created on: 2016年1月1日
 *      Author: terry
 */

#ifndef CVIDEOFRAMEFILTER_H_
#define CVIDEOFRAMEFILTER_H_

#include "FrameFilter.h"
#include "FilterGraph.h"


namespace av
{


class CVideoFrameFilter: public VideoFrameFilter
{
public:
	CVideoFrameFilter();
	virtual ~CVideoFrameFilter();

	virtual int filter(AVFrame* inFrame, AVFrame* outFrame);

	virtual int open(const std::string& filters);

	virtual void close();

	virtual bool isOpen();


	int setFilter(const std::string& filters);

	bool isActive();

	static bool checkFilter(const std::string& filters);


protected:
	int openGraph(AVFrame* frame);
	void closeGraph();

protected:
	std::string	m_filters;
	volatile int	m_changed;

	FilterGraph	m_graph;


};



} /* namespace av */

#endif /* CVIDEOFRAMEFILTER_H_ */
